package cn.xwlin.vo;

import com.alibaba.fastjson2.annotation.JSONField;
import com.google.common.collect.Lists;

import java.util.List;

public class CreateReq {
    @JSONField(name = "agree")
    private boolean agree = true;

    @JSONField(name = "id")
    private String id;

    @JSONField(name = "regions")
    private List<Region> regions;

    @JSONField(name = "users")
    private List<User> users;

    // 无参构造
    public CreateReq(String id, Region region, List<User> users) {
        this.agree = true;
        this.id = id;
        this.regions = Lists.newArrayList(region);
        this.users = users;
    }

    // getter和setter
    public boolean isAgree() {
        return agree;
    }

    public void setAgree(boolean agree) {
        this.agree = agree;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public List<Region> getRegions() {
        return regions;
    }

    public void setRegions(List<Region> regions) {
        this.regions = regions;
    }

    public List<User> getUsers() {
        return users;
    }

    public void setUsers(List<User> users) {
        this.users = users;
    }

    // 嵌套的Region类
    public static class Region {
        @JSONField(name = "region")
        private int region;

        @JSONField(name = "estate")
        private int estate;

        @JSONField(name = "num")
        private int num;

        @JSONField(name = "name")
        private String name;

        @JSONField(name = "price")
        private String price;

        @JSONField(name = "usable_count")
        private int usableCount;

        // 无参构造
        public Region() {
        }

        // getter和setter
        public int getRegion() {
            return region;
        }

        public void setRegion(int region) {
            this.region = region;
        }

        public int getEstate() {
            return estate;
        }

        public void setEstate(int estate) {
            this.estate = estate;
        }

        public int getNum() {
            return num;
        }

        public void setNum(int num) {
            this.num = num;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public int getUsableCount() {
            return usableCount;
        }

        public void setUsableCount(int usableCount) {
            this.usableCount = usableCount;
        }
    }

    // 嵌套的User类
    public static class User {
        @JSONField(name = "id")
        private int id;

        @JSONField(name = "uid")
        private int uid;

        @JSONField(name = "realname")
        private String realname;

        @JSONField(name = "real_card_id")
        private String realCardId;

        @JSONField(name = "phone")
        private String phone;

        @JSONField(name = "is_self")
        private boolean isSelf;

        @JSONField(name = "real_card_id2")
        private String realCardId2;

        @JSONField(name = "phone2")
        private String phone2;

        @JSONField(name = "timestamp")
        private long timestamp;

        @JSONField(name = "signature")
        private String signature;

        @JSONField(name = "disabled")
        private boolean disabled;

        @JSONField(name = "disabled2")
        private boolean disabled2;

        @JSONField(name = "showText")
        private String showText;

        // 无参构造
        public User() {
        }

        // getter和setter
        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getUid() {
            return uid;
        }

        public void setUid(int uid) {
            this.uid = uid;
        }

        public String getRealname() {
            return realname;
        }

        public void setRealname(String realname) {
            this.realname = realname;
        }

        public String getRealCardId() {
            return realCardId;
        }

        public void setRealCardId(String realCardId) {
            this.realCardId = realCardId;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public boolean isSelf() {
            return isSelf;
        }

        public void setSelf(boolean self) {
            isSelf = self;
        }

        public String getRealCardId2() {
            return realCardId2;
        }

        public void setRealCardId2(String realCardId2) {
            this.realCardId2 = realCardId2;
        }

        public String getPhone2() {
            return phone2;
        }

        public void setPhone2(String phone2) {
            this.phone2 = phone2;
        }

        public long getTimestamp() {
            return timestamp;
        }

        public void setTimestamp(long timestamp) {
            this.timestamp = timestamp;
        }

        public String getSignature() {
            return signature;
        }

        public void setSignature(String signature) {
            this.signature = signature;
        }

        public boolean isDisabled() {
            return disabled;
        }

        public void setDisabled(boolean disabled) {
            this.disabled = disabled;
        }

        public boolean isDisabled2() {
            return disabled2;
        }

        public void setDisabled2(boolean disabled2) {
            this.disabled2 = disabled2;
        }

        public String getShowText() {
            return showText;
        }

        public void setShowText(String showText) {
            this.showText = showText;
        }
    }
}